<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html style="overflow:hidden">
<head>
    <title>$!app_name</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- 框架 -->
	<link href="${base}/include/css/default.css" rel="stylesheet" type="text/css"/>
	<script type='text/javascript'>
		var CONTEXTPATH = '${base}';
	</script>
    <script src="${base}/include/js/main.js"></script>
    <script src="${base}/include/js/ajaxfileupload.js"></script>
<script type="text/javascript">  
 function ajaxFileUpload()
	{
	 	Page.MinMessage.Show({
	        text: '正在上传中', 
	        type: 'load' 
	    });
		jQuery.ajaxFileUpload
		(
			{
				url:'${base}/private/file/uploadOneSave',
				secureuri:true,
				fileElementId:'f',
				dataType: 'json',
				beforeSend:function()
				{ 
					
				},
				complete:function()
				{ 
					Page.MinMessage.Hide();
				},				
				success: function (data, status)
				{
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							Dialog.alert(data.error);
						}else
						{
							var obj=data.msg;
							$("#filename").val(obj.filename);
							$("#filepath").val(obj.filepath);
							$("#filesize").val(obj.filesize);
							$("#t1").hide();
							$("#t2").html("<span style=\"color:red;\">上传成功</span><br><br>文件名称："+obj.filename+"<br><br>"+"文件大小："+obj.filesize+"MB<br>");
							$("#t2").show();
						}
					}
				},
				error: function (data, status, e)
				{
					Dialog.alert(e);
				}
			}
		)
		 
		return false;

	}
</script>

<head>
<body leftmargin="0" topmargin="0"> 
<form name='form1' id="form1" method="post" enctype="multipart/form-data" >
<input type="hidden" name="filename" id="filename" value="">
<input type="hidden" name="filepath" id="filepath" value="">
<input type="hidden" name="filesize" id="filesize" value="">
<table width="100%" border="0" cellspacing="0" cellpadding="6" style="border-collapse: separate; border-spacing: 6px;">

    <tr>
        <td align="center">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td  align="left">
                            <table id="t1" width="100%" border="0" cellspacing="0" cellpadding="6" align="center" >

                                <tr>
                                    <td style="padding:20px 5px;">
                                        <table border="0" cellpadding="0" cellspacing="2"
                                               bordercolor="#FFFFFF" align="center" >
                                            <tr>
                                                <td width="40%" align="right" height="25">选择文件：</td>
                                                <td>  <input type="file" name="f" id="f"></input>
                                                </td>
                                            </tr>
                                            

                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                       <input type="button" value="上传" onclick="ajaxFileUpload()">
                                    </td>
                                </tr>
                            </table>
                            <div id="t2" style="display:none;"></div>
                        </td>
                    </tr>
                </table>

        </td>
    </tr>
</table>
</form>
</body>
</html>
